<template>
  <view class="demo">
    <nut-button type="primary" @click="handleClick">login api</nut-button>
    <test :title="'nihao'" ref="test1" @succc="succc"></test>
  </view>
</template>
  
<script setup>
import { ref } from 'vue';
import { login } from '../../api/login';
import test from '../../components/test.vue'
const test1 = ref()

const handleClick = async() => {
    const res = await login({
      password:'1216880480@qq.com',
      username:'111111'
    })
    console.log(res,'cccc')
    test1.value.open()
};

const succc =(v)=>{
  console.log(v)
}

</script>
  
<style>
.demo {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
</style>